#include "mdk_i.h"


sem_t g_ttsSem;


extern int tts_thread_init();
extern int tts_thread_kill();

extern u32 LDK_TTS_Run(void);

static int ep_stdin_call_back(int fd, int events, void *arg)
{
	//CORE_TRACE(("STDIN: %d %08x %p\n",fd,events,arg));
	static char al_Buffer[256];
	gets(al_Buffer);
	return MDK_TestLine(al_Buffer);
}


int main(int argc, const char* argv[])
{
	int i;
	int loop = 1;
	sem_init(&g_ttsSem, 0, 0);	

	int vl_Param;

	if(tts_thread_init() != 0)
	{
		perror("tts_thread_init");  
		return -2;
	}
	sleep(1);


	MDK_On_Init( &vl_Param );

	//MC_EP_INIT(STDIN_FILENO, EP_ID_STDIN, ep_stdin_call_back,NULL );
	//MC_EP_ADD(EPOLLIN,EP_ID_STDIN);
	
	while (loop)
	{
		for (i=0; i<=20; i++) {
			printf("~~for~~:%d\n", i);
			LDK_TTS_Run();
			sleep(1);
		}
		break;
	}

	tts_thread_kill();

	
	sem_destroy(&g_ttsSem);

	return 0;
}

